add missing ceil avx, sse functions#1207
add missing ceil avx, sse functions#1207kiranchandramohan merged 1 commit intoflang-compiler:masterfrom
Conversation
| __mth_i_ceil_sse(float x) | ||
| { | ||
| __asm__( | ||
| "roundss $0x2,%0,%0" |
There was a problem hiding this comment.
Is it correct to hardcode the rounding mode here? What if the program has called ieee_set_rounding_mode?
There was a problem hiding this comment.
From Intel's documentation:
Round to 00B Rounded result is the closest to the infinitely precise result. If two values are equally close, the result is nearest (even) the even value (i.e., the integer value with the least-significant bit of zero).
Round down 01B Rounded result is closest to but no greater than the infinitely precise result. (toward −∞)
Round up 10B Rounded result is closest to but no less than the infinitely precise result. (toward +∞)
Round toward 11B Rounded result is closest to but no greater in absolute value than the infinitely precise result. zero (Truncate)
What ever the current rounding mode the user has specified should not affect computing ceiling or floor.
There was a problem hiding this comment.
Thanks for the clarification.
This was noticed in #1120, but decided to implement as a separate PR.
cc @d-parks